package com.zhangbo.myapplication.provider;

import android.content.ContentProvider;
import android.content.ContentValues;
import android.database.Cursor;
import android.net.Uri;
import android.util.Log;

public class BookProvider extends ContentProvider {

    private static final String Tag = BookProvider.class.getSimpleName();

    @Override
    public boolean onCreate() {
        Log.e(Tag, "onCreate, current thread: " + Thread.currentThread());
        // TODO: Implement this to initialize your content provider on startup.
        return false;
    }

    @Override
    public int delete(Uri uri, String selection, String[] selectionArgs) {
        Log.e(Tag, "delete.");
        // Implement this to handle requests to delete one or more rows.
        throw new UnsupportedOperationException("Not yet implemented");
    }

    // Implement this to handle requests for the MIME type of the data
    @Override
    public String getType(Uri uri) {
        Log.e(Tag, "getType.");
        return "*/*";
    }

    @Override
    public Uri insert(Uri uri, ContentValues values) {
        Log.e(Tag, "insert.");
        // TODO: Implement this to handle requests to insert a new row.
        throw new UnsupportedOperationException("Not yet implemented");
    }

    @Override
    public Cursor query(Uri uri, String[] projection, String selection,
                        String[] selectionArgs, String sortOrder) {
        Log.e(Tag, "query, current thread: " + Thread.currentThread());
        // TODO: Implement this to handle query requests from clients.
        throw new UnsupportedOperationException("Not yet implemented");
    }

    @Override
    public int update(Uri uri, ContentValues values, String selection,
                      String[] selectionArgs) {
        Log.e(Tag, "update.");
        // TODO: Implement this to handle requests to update one or more rows.
        throw new UnsupportedOperationException("Not yet implemented");
    }
}
